package sctu.edu.java.year2016.team07.nieying.day20160521.chapter4_2;

/**
 * Created by Administrator on 2016/5/21 0021.
 */

/**
 * 2.编写Java程序，应用for循环打印菱形。
 */
public class lingxing {
    public static void main(String[] args){
        int r=7;
        System.out.println("打印的菱形是: \n");
        for(r=1;r<=7;r++){
                if(r==1||r==7){
                System.out.println("   *   ");
                }
                    if(r==2||r==6){
                      System.out.println("  ***  ");
                    }
                     if(r==3||r==5){
                        System.out.println(" ***** ");
                     }
                        if(r==4){
                         System.out.println("*******");
                        }
                }
            }
        }



